﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Quality_Calculator.Skills.Armorer
{
    class PieceByPiece : SynthSkill
    {
        public PieceByPiece()
        {
            Name = "Piece By Piece";
            Icon = global::Quality_Calculator.Properties.Resources.Piece_by_Piece;
            CpCost = 15;
            Chance = 90;
            DurabilityCost = 10;
        }
        public override void SpellEffect(Synthesis synth)
        {
            int chance = Chance;
            if (synth.HasBuff(eSpell.SteadyHands)) chance = chance + 20;
            if (synth.HasBuff(eSpell.SteadyHands2)) chance = chance + 30;
            if (synth.Randomize() <= chance)
            {
                int Remaining = synth.ProgressMax - synth.ProgressCurrent;
                synth.ProgressCurrent += (int)Math.Round((double)Remaining / 3);
            }
            synth.LooseDurability(DurabilityCost);
        }
    }
}
